<?php
  $alternatif = $this->session->userdata('alternatif');
  $kriteria = $this->session->userdata('kriteria');
  $bobot = $this->session->userdata('bobot');
?>
<div class="data-list">
    <fieldset>
        <legend><?php echo "$formTitle";?></legend>
        <fieldset>
            <legend>Daftar Alternatif & Kriteria Pemilihan</legend>    
            <table style="border: none;width: 40%;">
                <tr>
                    <td width="50%">
                        <table class="tabel" width="100%">
                            <tr>
                                <th colspan="2">Alternatif</th>
                            </tr>
                            <?php
                             $no = 0;
                             foreach ($alternatif['nama'] as $alt){
                            ?>
                            <tr class="<?php echo ($no%2)?'odd':'even';?>">
                                <td><?php echo "A".$alternatif['id'][$no];?></td>
                                <td><?php echo "$alt";?></td>
                            </tr>
                            <?php
                             $no++;
                             }
                            ?>
                        </table>
                    </td>
                    <td>
                        <table class="tabel" width="100%">
                            <tr>
                                <th colspan="2">Kriteria</th>
                            </tr>
                            <?php
                             $no = 0;
                             foreach ($kriteria['nama'] as $kri){
                            ?>
                            <tr class="<?php echo ($no%2)?'odd':'even';?>">
                                <td><?php echo "C".$kriteria['id'][$no];?></td>
                                <td><?php echo "$kri";?></td>
                            </tr>
                            <?php
                             $no++;
                             }
                            ?>
                        </table>
                    </td>
                </tr>
            </table>
        </fieldset>    
        <?php
          echo form_open($subLink);
        ?>  
        <table class="tabel" width="50%">
            <tr>
                <th rowspan="2" style="width: 10%;vertical-align: middle">Alternatif</th>
                <th colspan="<?php echo count($kriteria['id']);?>">Kriteria</th>
            </tr>
            <tr>
                <?php
                  foreach ($kriteria['id'] as $kri){
                ?>
                <th><?php echo "C".$kri;?></th>
                <?
                  }
                ?>
            </tr>
            <?php
              $no = 1;
              foreach ($alternatif['id'] as $alt){
            ?>
            <tr class="<?php echo ($no%2)?'even':'odd';?>">
               <td style="text-align: center;"><?php echo "A".$alt;?></td>
               <?php
                  foreach ($kriteria['id'] as $kri){
                ?>
                <td><input type="text" name="data[<?php echo "$kri";?>][]" style="border: 1px solid #cccccc"/></td>
                <?
                  }
                ?>
            </tr>
            <?
              $no++;
              }
            ?>
        </table>
        <?php
          echo form_button('back', 'Kembali', 'class=prev onClick='."javascript:location.href='".base_url()."index.php/pemilihan_adik_asuh/pilih_kriteria'".'');
          echo form_submit("add", "Selanjutnya", "class='next' style='margin-right:2px'");
          echo form_close();
        ?>
    </fieldset>
</div>
